from django.urls import path
from app.views import LoginView, RegisterView, UserView, DisordersTypeView, UserDataView, UserDataInfoView, \
    QuestionnaireView, QuestionItemView, QuestionnaireInfoView, ScoreResultView, EmgDataView, Prescription, \
    LiteratureKnowledgeInfo, LiteratureKnowledgeView, MagneticStimulusPrescriptionsView, \
    MagneticStimulusPrescriptionsInfo, ElectricalStimulusPrescriptionsView, ElectricalStimulusPrescriptionsInfo, \
    UserDataList
from rest_framework_simplejwt.views import TokenRefreshView,TokenVerifyView

urlpatterns = [
    #登录
    path('login', LoginView.as_view()),
    # 注册
    path('register', RegisterView.as_view()),
    #刷新token
    path('token/refresh',TokenRefreshView.as_view()),
    #校验token
    path('token/verify',TokenVerifyView.as_view()),
    #获取单个用户信息
    path('<int:pk>',UserView.as_view({'get':'retrieve'})),
    # post指定到upload_file方法
    # path('<int:pk>/',UserView.as_view({'post':'upload_file'}))
    # 障碍类型
    path('disordersType', DisordersTypeView.as_view()),

    #用户病例列表
    path('userDatalist', UserDataList.as_view()),
    # 用户详细
    path('userData', UserDataView.as_view()),
    path('userDataInfo/<int:pk>', UserDataInfoView.as_view()),
    # 编辑问卷
    path('questionnaire', QuestionnaireView.as_view()),
    path('questionItem', QuestionItemView.as_view()),
    # 获取问卷
    path('questionnaire/<int:pk>', QuestionnaireInfoView.as_view()),
    path('scoreresult', ScoreResultView.as_view()),
    path('emgdata', EmgDataView.as_view()),
    #处方
    path("prescription",Prescription.as_view()),

    #文献知识库
    path('literatureknowledge/<int:pk>',LiteratureKnowledgeInfo.as_view({'get':'retrieve','put':'update','delete':'destroy'})),
    path('literatureknowledgeview',LiteratureKnowledgeView.as_view({'get':'list','post':'create'})),

    #磁刺激处方知识库
    path('magneticstimulusprescriptions/<int:pk>',MagneticStimulusPrescriptionsInfo.as_view({'get':'retrieve','put':'update','delete':'destroy'})),
    path('magneticstimulusprescriptionsview',MagneticStimulusPrescriptionsView.as_view({'get':'list','post':'create'})),

    #电刺激处方知识库
    path('electricalstimulusprescriptions/<int:pk>',ElectricalStimulusPrescriptionsInfo.as_view({'get':'retrieve','put':'update','delete':'destroy'})),
    path('electricalstimulusprescriptionsview',ElectricalStimulusPrescriptionsView.as_view({'get':'list','post':'create'})),




]
